<template>
	<view id="notice" style="background-color: rgb(246,246,246);">
		<van-notify id="van-notify" />
		<van-nav-bar
		  title="站内信"
		  left-text="返回"
		  fixed=true
		  placeholder=true
		  left-arrow
		  @click-left="onClickLeft"
		/>
		<view class="contentdiv">
			<view v-for="(item,index) in msglist" :key="index" class="msg">
				<view class="msgtime">
					{{item.time}}
				</view>
				<u-parse :content="item.content" class="msgcon"></u-parse>
			</view>
		</view>
		
	</view>
</template>

<script>
	import request from '../../com/request.js'	
	export default {
		components: {
		},
		data() {
			return {
				msglist:[]
			}
		},
		methods: {
			onClickLeft() {
				uni.redirectTo({
					url: "/pages/newspage/newspage"
				});
			},
			getmsg(){
				request({
					url:'api/usergetstandmsg',
					data:{
						userTel:uni.getStorageSync("userTel")
					},
					success:(resp)=>{
						console.log(resp,33);
						this.msglist=resp.data.data
					}
				})
			}
		},
		onLoad() {
			this.getmsg()
			this.socket.on('sysmsg', (msg) => {
				console.log(msg);
					this.getmsg()
			})
		}
	}
</script>

<style scoped>
	.msg{
		max-width: 680rpx;
		
		margin: 30px auto;
		border: 1px solid beige;
		border-radius: 5px;
		text-align: center;
	}
	.msgtime{
		font-size: 12px;
		color: rgb(0,0,0,0.4);
		margin-bottom: 10px;
	}
	#notice >>> ._root{
		background-color: rgb(255,255,255);
		width: 100%;
		min-height: 200px;
		border-radius: 4%;
		box-sizing: border-box;
		padding: 10rpx;
		
	}
	#notice >>> ._root image{
		width: 600rpx !important;
		height: 250px !important;
		border-radius: 5%;
		
	}
	#notice >>> ._root .p{
		width: 100%;
		display: flex;
		flex-direction: column;
		line-height: 35px;
		font-size: 20px;
		text-align: start;
		color: rgb(254,233,142);
		font-weight: 700;
		align-items: center;
	}
</style>
